Feature/add file support for messenger#185
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds file and image support (multimodal capabilities) to Telegram and Facebook Messenger integrations, enabling AI agents to analyze images and documents sent by users.
Key Changes:
- Implemented file/image download and base64 encoding for both Telegram and Messenger integrations
- Added multimodal request handling via
service.run_multi()to process text, images, and files together - Enhanced session management to preserve multimodal conversation context in OpenAI framework
- Updated documentation with multimodal feature descriptions, limitations, and usage examples
- Added Google ADK integration examples alongside existing OpenAI examples
Reviewed changes
Copilot reviewed 13 out of 29 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
examples/containerized/openai/uv.lock |
Downgraded openai-agents from 0.6.4 to 0.6.3; updated revision |
examples/cli/openai/uv.lock |
Updated revision number |
examples/cli/openai-dynamic/uv.lock |
Downgraded openai-agents; updated revision |
examples/cli/multi/uv.lock |
Downgraded openai-agents; updated revision |
examples/aws-serverless/openai/uv.lock |
Downgraded openai-agents; updated revision |
examples/aws-containerized/openai-dynamodb/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/whatsapp/uv.lock |
Changed agentkernel source from local path to PyPI registry |
examples/api/telegram/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/telegram/server_adk.py |
New Google ADK-based Telegram bot example with multimodal support |
examples/api/telegram/build.sh |
Added 'adk' to the local build dependencies |
examples/api/telegram/README.md |
Comprehensive multimodal documentation with usage examples and file type tables |
examples/api/slack/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/openai/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/messenger/uv.lock |
Changed agentkernel to local source; downgraded multiple packages |
examples/api/messenger/server_adk.py |
New Google ADK-based Messenger bot example with multimodal support |
examples/api/messenger/build.sh |
Added 'adk' to the local build dependencies |
examples/api/messenger/README.md |
Added multimodal feature documentation with file types and size limits |
examples/api/mcp/multi/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/instagram/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/hooks/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/gmail/uv.lock |
Downgraded openai-agents; updated revision |
examples/api/a2a/multi/uv.lock |
Downgraded openai-agents; updated revision |
docs/docs/integrations/telegram.md |
Enhanced documentation with multimodal features, usage examples, and limitations |
docs/docs/integrations/messenger.md |
Added comprehensive multimodal documentation with implementation details |
ak-py/src/agentkernel/integration/telegram/telegram_chat.py |
Core implementation for file/image download, processing, and multimodal request handling |
ak-py/src/agentkernel/integration/telegram/README.md |
Technical documentation for multimodal support with configuration details |
ak-py/src/agentkernel/integration/messenger/messenger_chat.py |
Core implementation for attachment processing with file size validation |
ak-py/src/agentkernel/integration/messenger/README.md |
Technical documentation for multimodal support with security considerations |
ak-py/src/agentkernel/framework/openai/openai.py |
Added session persistence for multimodal conversations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 26 changed files in this pull request and generated 21 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 26 changed files in this pull request and generated 17 comments.
Comments suppressed due to low confidence (1)
ak-py/src/agentkernel/integration/messenger/messenger_chat.py:5
- Import of 'mimetypes' is not used.
import traceback
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 26 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 32 changed files in this pull request and generated 19 comments.
Comments suppressed due to low confidence (1)
ak-py/src/agentkernel/framework/langgraph/langgraph.py:433
- The LangGraphToolBuilder.bind() method now wraps a StructuredTool.from_function() call with func=None and only provides coroutine parameter. This breaks synchronous function support. If a non-async function is passed, the isinstance check on line 424 will fail, and the code will fall through without handling sync functions. The original code likely handled both sync and async functions. Add an else branch to handle synchronous functions with func parameter instead of coroutine.
if asyncio.iscoroutinefunction(func):
tools.append(
StructuredTool.from_function(
func=None,
coroutine=func,
name=func.__name__,
description=func.__doc__ or func.__name__,
)
)
else:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
51d60b9 to
001ea57
Compare
Description
This change will add file & image support for messenger integrations
Type of Change
Testing
Checklist
Screenshots (if applicable)
Additional Notes